-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno support #12397
Deno support #12397
Conversation
…st failures re: #9056
… async/await for better debug
tested it locally and seems to be fine, though there are some errors which dont seem to be consistent, but dont really happen in normal node: 2862 passing (5m)
31 pending
5 failing
1) Model
dropDatabase() after init allows re-init (gh-6967):
MongoNetworkError: connection 3 to 127.0.0.1:27017 closed
at Connection.onClose (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:135:19)
at Socket.<anonymous> (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:62:46)
at Socket.emit (https://deno.land/[email protected]/node/_events.mjs:391:35)
at https://deno.land/[email protected]/node/net.ts:1417:14
at TCP.close (https://deno.land/[email protected]/node/internal_binding/handle_wrap.ts:37:5)
at Socket._destroy (https://deno.land/[email protected]/node/net.ts:1409:20)
at _destroy (https://deno.land/[email protected]/node/internal/streams/destroy.mjs:96:25)
at Socket.destroy (https://deno.land/[email protected]/node/internal/streams/destroy.mjs:58:5)
at Timeout.<anonymous> (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:145:27)
at https://deno.land/[email protected]/node/timers.ts:21:21
at Object.action (deno:ext/web/02_timers.js:149:13)
at handleTimerMacrotask (deno:ext/web/02_timers.js:66:12)
2) Model
"after each" hook for "dropDatabase() after init allows re-init (gh-6967)":
Error: Timeout of 8000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/mnt/projects/nodejs/mongoose/test/model.test.js)
at https://deno.land/[email protected]/node/timers.ts:21:21
at Object.action (deno:ext/web/02_timers.js:149:13)
at handleTimerMacrotask (deno:ext/web/02_timers.js:66:12)
3) Query
deleteOne/deleteMany
handles deleteMany:
MongoNetworkError: connection 2 to 127.0.0.1:27017 closed
at Connection.onClose (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:135:19)
at Socket.<anonymous> (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:62:46)
at Socket.emit (https://deno.land/[email protected]/node/_events.mjs:391:35)
at https://deno.land/[email protected]/node/net.ts:1417:14
at TCP.close (https://deno.land/[email protected]/node/internal_binding/handle_wrap.ts:37:5)
at Socket._destroy (https://deno.land/[email protected]/node/net.ts:1409:20)
at _destroy (https://deno.land/[email protected]/node/internal/streams/destroy.mjs:96:25)
at Socket.destroy (https://deno.land/[email protected]/node/internal/streams/destroy.mjs:58:5)
at Timeout.<anonymous> (file:///mnt/projects/nodejs/mongoose/node_modules/mongodb/lib/cmap/connection.js:145:27)
at https://deno.land/[email protected]/node/timers.ts:21:21
at Object.action (deno:ext/web/02_timers.js:149:13)
at handleTimerMacrotask (deno:ext/web/02_timers.js:66:12)
4) Query
"after each" hook for "handles deleteMany":
Error: Timeout of 8000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/mnt/projects/nodejs/mongoose/test/query.test.js)
at https://deno.land/[email protected]/node/timers.ts:21:21
at Object.action (deno:ext/web/02_timers.js:149:13)
at handleTimerMacrotask (deno:ext/web/02_timers.js:66:12)
5) Query
"after all" hook for "skips applying default projections over slice projections (gh-11940)":
Error: Timeout of 8000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/mnt/projects/nodejs/mongoose/test/query.test.js)
at https://deno.land/[email protected]/node/timers.ts:21:21
at Object.action (deno:ext/web/02_timers.js:149:13)
at handleTimerMacrotask (deno:ext/web/02_timers.js:66:12) normal node run on my system 3246 passing (3m)
47 pending
6 failing
1) model: querying:
lean
casts $elemMatch (gh-2199):
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/mnt/projects/nodejs/mongoose/test/model.querying.test.js)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)
2) Model
can be created using _id as embedded document:
Uncaught AssertionError [ERR_ASSERTION]: undefined == 'Daniel'
at /mnt/projects/nodejs/mongoose/test/model.test.js:117:16
at /mnt/projects/nodejs/mongoose/lib/model.js:5135:18
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
3) Model
getters
nested
pre-existing null object re-save:
Uncaught AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Operation `Test.findOne()` buffering timed out after 10000ms
at /mnt/projects/nodejs/mongoose/test/model.querying.test.js:2477:18
at /mnt/projects/nodejs/mongoose/lib/model.js:5135:18
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
at Timeout.<anonymous> (lib/drivers/node-mongodb-native/collection.js:153:23)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)
4) Model
bug fixes
createCollection() enforces expireAfterSeconds (gh-11229):
Uncaught AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Operation `Test.updateOne()` buffering timed out after 10000ms
at /mnt/projects/nodejs/mongoose/test/model.test.js:1889:20
at /mnt/projects/nodejs/mongoose/lib/model.js:5135:18
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
at Timeout.<anonymous> (lib/drivers/node-mongodb-native/collection.js:153:23)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)
5) Model
bug fixes
createCollection() enforces expires when set by Schema (gh-11229):
AssertionError [ERR_ASSERTION]: 12 == 0
+ expected - actual
-12
+0
at Context.<anonymous> (test/model.test.js:7203:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
6) Model
bug fixes
createCollection() enforces expireAfterSeconds (gh-11229):
done() called multiple times in test <Model bug fixes createCollection() enforces expireAfterSeconds (gh-11229)> of file /mnt/projects/nodejs/mongoose/test/model.test.js; in addition, done() received error: MongooseError: Operation `TestGH11229Var1.count()` buffering timed out after 10000ms
at Timeout.<anonymous> (/mnt/projects/nodejs/mongoose/lib/drivers/node-mongodb-native/collection.js:153:23)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)
Error: done() called multiple times in test <Model bug fixes createCollection() enforces expireAfterSeconds (gh-11229)> of file /mnt/projects/nodejs/mongoose/test/model.test.js; in addition, done() received error: MongooseError: Operation `TestGH11229Var1.count()` buffering timed out after 10000ms
at Timeout.<anonymous> (lib/drivers/node-mongodb-native/collection.js:153:23)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also looks good to me, though i still dont know why in deno so many timeout / connection close errors are happening locally (see earlier comment)
@hasezoey what version of Deno are you using? |
deno 1.25.1 PS: sometimes i also get the timeouts with node, but it seems to be more common in deno because deno somehow runs slower than node (see the time in the comment, where deno was Edit: i am on the machine again and can provide deno 1.25.1 (release, x86_64-unknown-linux-gnu)
v8 10.6.194.5
typescript 4.7.4 |
Moving this to 6.8, still waiting on feedback from Deno team. |
@vkarpov15 |
Does this really need a |
@roj1512 could you explain what you mean? |
Do we need NPM and |
read the deno documentation at NPM Specifiers TL;DR:
unless option though note that i did not use this yet so i cannot verify that this is actually true (probably deno still has a cache somewhere) |
Sad. |
Currently yes, you do need npm and node_modules. We'll consider improving this in the future. |
if (typeof Deno !== 'undefined') { | ||
// In Deno dns throws an uncatchable error here. | ||
return this.skip(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, are there any news regarding this "uncatchable dns error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hasezoey nope, I don't think this issue is significant enough to block shipping deno support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didnt mean to block with this question, just wanted to ask if there are any known updates regarding this problem to re-enable the test for deno
Summary
Tests are passing against Deno 👍 Still with
--unstable
, so there's some cleanup there, but this is still a big step.For the most part, no noteworthy runtime issues beyond #12313. Just a bunch of test issues due to our tests being a bit sloppy with schematype global state cleanup, and a quirk with dns resolution throwing an uncatchable error. We'll sort those out a little more later.
Examples